<p>The SQL Console is Trilium's built-in database editor.</p>
<p>It can be accessed by going to the <a href="#root/_help_Vc8PjrjAGuOp">global menu</a> →
  Advanced → Open SQL Console.</p>
<p>
  <img src="SQL Console_image.png">
</p>
<h3>Interaction</h3>
<ul>
  <li>
    <p>Hovering the mouse over one of the tables listed at the top of the document
      will show the columns and their data type.</p>
  </li>
  <li>
    <p>Only one SQL statement can be run at once.</p>
  </li>
  <li>
    <p>To run the statement, press the
      <img src="3_SQL Console_image.png">icon.</p>
  </li>
  <li>
    <p>For queries that return a result, the data will displayed in a table.</p>
    <p>
      <img src="1_SQL Console_image.png">
    </p>
  </li>
</ul>
<h3>Saved SQL console</h3>
<p>SQL queries or commands can be saved into a dedicated note.</p>
<p>To do so, simply write the query and press the
  <img src="2_SQL Console_image.png">button. Once saved, the note will appear in&nbsp;<a href="#root/_help_l0tKav7yLHGF">Day Notes</a>.</p>
<ul>
  <li>The SQL expression will not be displayed by default, but it can still
    be viewed by going to the note context menu and selecting <em>Note source</em>.</li>
  <li>The expression cannot be modified. If needed, recreate it by copying the
    statement back into the SQL console and then saving it again.</li>
</ul>